package com.houcine.actions;

import java.util.List;

import com.houcine.entity.Book;
import com.houcine.services.GenericService;

public class BookAction extends FrontendAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6959498061844657004L;
	
	private GenericService<Book> service;
	
	   
	private List<Book> books;
    
    private Book book;
    
    public BookAction(GenericService<Book> service) {
        this.service = service;
    }
    
    public String list() {
        setBooks(service.list(page, size));
        return SUCCESS;
    }
    public String update() {
        service.update(book);
        return SUCCESS;
    }
    public String create() {
        service.create(book);
        return SUCCESS;
    }
   
	public List<Book> getBooks() {
		return books;
	}

	public void setBooks(List<Book> books) {
		this.books = books;
	}

}
